package com.work.saturn.interesting;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.immo.libcommon.base.BaseHeadActivity;
import com.immo.libcommon.utils.FullyLinearLayoutManager;
import com.work.saturn.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author YaoChen
 * @content 未来局详情
 * @date 2018/07/16
 */
public class InterestDetailActivity extends BaseHeadActivity {
    @BindView(R.id.interest_detail_title)
    TextView interestDetailTitle;
    @BindView(R.id.interest_detail_person)
    TextView interestDetailPerson;
    @BindView(R.id.interest_detail_time)
    TextView interestDetailTime;
    @BindView(R.id.interest_detail_list)
    RecyclerView mList;
    @BindView(R.id.interest_detail_password)
    EditText interestDetailPassword;
    @BindView(R.id.interest_detail_ll)
    LinearLayout interestDetailLl;
    @BindView(R.id.interest_detail_back)
    TextView interestDetailBack;
    private List<String> datas = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_interset_detail);
        //禁止进入时弹出软键盘
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
        ButterKnife.bind(this);
        setTitle("未来局");
        for (int i = 0; i <4 ; i++) {
            datas.add("德国巴西印度");

        }
        initData();
    }

    private void initData() {
        FullyLinearLayoutManager linearLayoutManagerTheme = new FullyLinearLayoutManager(this);
        linearLayoutManagerTheme.setOrientation(LinearLayoutManager.VERTICAL);
        mList.setLayoutManager(linearLayoutManagerTheme);
        InterestingListAdapter releaseDetailAdapter = new InterestingListAdapter();
        //设置适配器
        releaseDetailAdapter.bindToRecyclerView(mList);
    }

    /**
     * 资产历史列表
     */
    private class InterestingListAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
        InterestingListAdapter() {
            super(R.layout.item_interes_detail, datas);
        }

        @Override
        protected void convert(BaseViewHolder helper, String item) {
            helper.setText(R.id.interest_detail_person, item.toString());
        }

    }

    @OnClick({R.id.interest_detail_submit, R.id.interest_detail_back})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.interest_detail_submit:
                break;
            case R.id.interest_detail_back:
                finish();
                break;
        }
    }
}
